<template>
  <div>
    <component :is="currentComponent" :addFormQueryParam=addFormQueryParam :editFormQueryParam=editFormQueryParam @goNextStep="choiceWarehouse" @edit="edit" @addInventoryCheck="addInventoryCheck"  @handleCancel="handleCancel" ref="childComponent" />
  </div>
</template>

<script>
import List from "./list"
import ChoiceWarehouse from "./choiceWarehouse"
import AddWmsInventoryCheck from "./addWmsInventoryCheck"
import EditWmsInventoryCheck from "./editWmsInventoryCheck"
export default {
  name: "Index",
  components: {List,ChoiceWarehouse,AddWmsInventoryCheck,EditWmsInventoryCheck},
  data() {
    return {
      currentComponent:"List",
      addFormQueryParam:{},
      editFormQueryParam:{}
    }
  },
  created() {
  },
  methods: {
    addInventoryCheck(addFormQueryParam){
      this.addFormQueryParam=addFormQueryParam;
      this.currentComponent = "AddWmsInventoryCheck"
    },
    choiceWarehouse(){
      this.currentComponent = "ChoiceWarehouse"
    },
    handleCancel(){
      this.currentComponent = "List"
    },
    edit(queryParams){
      this.editFormQueryParam= queryParams;
      console.log(queryParams);
      this.currentComponent = "EditWmsInventoryCheck"
    },
  }
}
</script>
